/* Copyright (c) 2004-2024 peigen.info. All rights reserved. */

package info.peigen.hotpot.common.service.base.test;

import info.peigen.hotpot.common.core.test.TestBase;
import lombok.extern.slf4j.Slf4j;

/**
 * <b>(RepositoryTestBase)</b>
 *
 * @author Peigen
 * @version 1.0.0
 * @since 2022/11/17
 */
@SuppressWarnings("unused")
@Slf4j
public class RepositoryTestBase extends TestBase {

    public void executeRepositoryTest(RepositoryTestContext repositoryTestContext, RepositoryTestInvoke invoke) {
        // 0. callStartTime
        long callStartTime = System.currentTimeMillis();

        // 1. deleteData
        invoke.deleteData(repositoryTestContext);

        // 2. insertData
        invoke.insertData(repositoryTestContext);
        p(repositoryTestContext);

        // 3. insertAssert
        invoke.insertAssert(repositoryTestContext);

        // 4. updateData
        invoke.updateData(repositoryTestContext);
        p(repositoryTestContext);

        // 5. updateAssert
        invoke.updateAssert(repositoryTestContext);

        log.info("测试耗时:{}ms", System.currentTimeMillis() - callStartTime);
    }
}